Skip to content

fix(camera): portrait preview aspect ratio + rebrand demo to 'Document Scanner' with icon#39

Merged
Nardo86 merged 2 commits into
mainfrom
fix/camera-preview-portrait
Jun 11, 2026
Merged

fix(camera): portrait preview aspect ratio + rebrand demo to 'Document Scanner' with icon#39
Nardo86 merged 2 commits into
mainfrom
fix/camera-preview-portrait

Conversation

@Nardo86

@Nardo86 Nardo86 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

On-device the guided camera preview rendered as a small, horizontally-squashed landscape box on a portrait screen. Cause: CameraController.value.aspectRatio is the sensor ratio in landscape orientation; wrapping CameraPreview in AspectRatio with it produces a wide/short box in portrait. Fix: invert the ratio in portrait so the preview fills the screen undistorted (and the trapezoid guide aligns with the portrait captured image).

🤖 Generated with Claude Code

Eros Nardi and others added 2 commits June 11, 2026 11:16
controller.value.aspectRatio is the sensor ratio in landscape (>=1); using it
directly forced the preview into a wide/short box on a portrait screen — small
and horizontally squashed. Invert it in portrait so the preview fills the
screen undistorted, which also aligns the guide overlay with the (portrait)
captured image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- App label "example" -> "Document Scanner".
- New launcher icon (legacy + adaptive): a sheet of paper with a smartphone
  scanning it (green scan brackets + beam) on a blue gradient, generated via
  flutter_launcher_icons from assets/icon/*. Reproducible with
  example/tool/make_icon.py (Pillow).
- APK output renamed DocumentScanner_v<version>.apk in both workflows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Nardo86 Nardo86 changed the title fix(camera): correct guided preview aspect ratio in portrait fix(camera): portrait preview aspect ratio + rebrand demo to 'Document Scanner' with icon Jun 11, 2026
@Nardo86 Nardo86 merged commit 51beeaa into main Jun 11, 2026
2 of 3 checks passed
@Nardo86 Nardo86 deleted the fix/camera-preview-portrait branch June 11, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant